//  文件模块接口
// import { get,post } from './http'
import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage'
import Vue from 'vue'
import {UI_CACHE_DB_DICT_DATA } from "@/store/mutation-types"

/**
 * 查询文件相关api
 */
//获取文件的树结构
export const getFileTree = (params)=>getAction('/file/aeeUserFile/dir/tree', params);
// 获取回收站文件列表
export const getRecoveryFile = (params)=>getAction('/file/aeeUserFile/list/recycle', params);
// 获取路径树字典
export const getPathTreeMap = (params)=>getAction('/file/aeeUserFile/path/tree', params)
// 通过文件类型选择文件
export const selectFileByFileType = (params)=>getAction('/file/aeeUserFile/list/type', params);
// 搜索文件
export const searchFile = (params)=>getAction('/file/aeeUserFile/search', params)
// 获取当前目录下的所有文件
export const getFileList = (params)=>getAction('/file/aeeUserFile/list', params);
/**
 * 文件上传下载
 */
// 合并切片
export const mergeFile = (params)=>postAction('/transfer/merge', params);
// 下载文件
export const downloadFile = (params)=>getAction("/file/aeeFile/download/"+params);
export const getDownloadFile = (params)=>getAction("/file/aeeFile/getFilePath/"+params);
// 获取略缩图
export const getThumbnail = (params)=>getAction('/transfer/thumbnail/' + params);

/**
 * 创建文件
 */
// 创建文件夹
export const makeDir = (params)=>postAction('/file/aeeUserFile/mkdir', params);
// 恢复回收站文件
export const recoverRecycleFile = (params)=>postAction('/file/aeeUserFile/recover', params)
// 恢复回收站文件
export const batchRecoverRecycle = (params)=>postAction('/file/aeeUserFile/batch/recover', params)


/**
 * 删除文件
 */
//删除文件
export const deleteFile = (params)=>postAction('/file/aeeUserFile/delete', params);
// 回收站文件删除
export const deleteRecoveryFile = (params)=>postAction('/file/aeeUserFile/delete/recycle', params);
// 批量删除回收站文件
export const batchDeleteRecoveryFile = (params)=>postAction('/file/aeeUserFile/batch/delete/recycle', params)
//批量删除文件
export const batchDeleteFile = (params)=>postAction('/file/aeeUserFile/batch/delete', params);

/**其他*/
//移动文件
export const moveFile = (params)=>postAction('/file/aeeUserFile/move', params);
//批量移动文件
export const batchMoveFile = (params)=>postAction('/file/aeeUserFile/batch/move', params);
//获取存储占用
export const getStorage = (params)=>getAction('/user/storage/info', params);
//重命名文件
export const renameFile = (params)=>postAction('/file/aeeUserFile/rename', params);

/**未实现*/
export const unzipfile = (params)=>postAction('/file/aeeUserFile/unzip', params); //解压文件

////////////////////
// 获取当前目录下的所有文件
export const getDepartFileList = (params)=>getAction('/departfile/aeeDepartFile/list', params);
export const getDepartPathTreeMap = (params)=>getAction('/departfile/aeeDepartFile/path/tree', params)
// 创建文件夹
export const makeDirDepart = (params)=>postAction('/departfile/aeeDepartFile/mkdir', params);
//重命名文件
export const DepartRenameFile = (params)=>postAction('/departfile/aeeDepartFile/rename', params);

export const getDownloadDepartFile = (params)=>getAction("/departfile/aeeDepartFile/getFilePath/"+params);
export const deleteDepartFile = (params)=>postAction('/departfile/aeeDepartFile/delete', params);
export const searchDepartFile = (params)=>getAction('/departfile/aeeDepartFile/search', params)










